import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import local_get from '@dfeidao/atom-web/local/get';
import fire_to from '@dfeidao/atom-web/msg/fire';
import msg_error from '@dfeidao/atom-web/msgbox/error';
import a002 from './a002';
// 确定返回
export default async function a005(fd: IFeidaoAiBrowserComponent) {
	const box = fd.data.node.querySelectorAll<HTMLInputElement>('[name="ck"]:checked');
	if (box.length > 0) {
		const data = new Array();
		Array.from(box).forEach((a: HTMLInputElement) => {
			data.push(JSON.parse(a.getAttribute('data')));
		});
		if (local_get(fd, "sort") === "inst") {
			fire_to('zj-000003', 'a006', { data });
		}
		if (local_get(fd, "sort") === "upd") {
			fire_to('zj-000004', 'a006', { data });
		}
		if (local_get(fd, "sort") === "group") {
			fire_to('zj-000002', 'a006', { data });
		}
		await a002(fd);
	} else {
		msg_error("未选中任何控制点");
	}
}
